<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="ESP.VO.Role"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <jsp:include page="../include.jsp" flush="true"/>
	<script type="text/javascript">
	$(function(){
		if(user_role_id != '5'){
			$('div').remove();
			$('body').append('<h1>您无权操作!</h1>');
			return false;
		}
	});
	function initPsw(){
		var rows = $('#user_info').datagrid('getSelected');
		if(!rows){
			show('请先选择一行数据！');
			return false;
		}
		$.post('a02!initPsw',{
			user_role_id:user_role_id,
			user_id:rows.user_id
		},function(message){
			show(message.returnMsg);
		});
	}
	function query(){
		if(user_role_id != '5'){
			alert('您无此权限！');
			return false;
		}
		var params = $('#user_info').datagrid('options').queryParams;
        var fields =$('#query-form').serializeArray();
        $.each( fields, function(i, field){
            params[field.name] = field.value;
        });   
        $('#user_info').datagrid('reload');
	}
	function reject(){
		$('#user_info').datagrid('clearSelections');
	} 
</script>
	
  </head>
  <body>
  	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'center',border:false" title="系统管理>>忘记密码">
			<table id="user_info" class="easyui-datagrid" 
					data-options="singleSelect:true,fit:true,fitColumns:'true',rownumbers:true,singleSelect:true,url:'a02!queryUser?user_role_id='+user_role_id,toolbar:'#tb'">
				<thead>
					<tr>
						<th data-options="field:'user_id',width:100">工/学号</th>
						<th data-options="field:'user_name',width:100">姓名</th>
					</tr>
				</thead>
			</table>
			<div id="tb" style="padding-left:5px;padding-top:5px;height:30px">
				<form id="query-form">
					工/学号<input type="text" class="easyui-validatebox" name="user_id" style="width:90px;">
					<a href="javascript:void(0)" onclick="query()" class="easyui-linkbutton" iconCls="icon-search" plain=true>查询</a>&nbsp;|
					<a href="javascript:void(0)" onclick="initPsw()" class="easyui-linkbutton" iconCls="icon-edit" plain="true">初始密码</a>&nbsp;|
					<a href="javascript:void(0)" onclick="reject()" class="easyui-linkbutton" iconCls="icon-undo" plain="true">返回</a>&nbsp;|
					<a href="javascript:void(0)" onclick="reject()" class="easyui-linkbutton" iconCls="icon-help" plain="true">帮助</a>
				</form>
			</div>
		</div>
	</div>
  </body>
</html>
